﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace WcfFlashRemoting.Example6.WcfClient
{
    class Program
    {
        static void Main(string[] args)
        {
            Example6Service.ICalculatorContract svc = new Example6Service.CalculatorContractClient("AmfBinding_ICalculatorContract");
            try
            {
                svc.Add(new Example6Service.MathParameters(new Example6Service.AuthenticationHeader() { User = "bad" }, 1.3, 2.6));
            }
            catch (FaultException<Example6Service.NotAuthorizedFault> ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.WriteLine(svc.Add(new Example6Service.MathParameters(new Example6Service.AuthenticationHeader() { User = "good" }, 1.3, 2.6)).Result);
            Console.ReadKey();
        }
    }
}
